import request from '@/utils/request'


/**查询仓库区域列表 */
export function getStockPositionAreaList() {
  return request({
    url: `/distribution/stockPositionArea/list`,
  })
}



/**新增仓库区域 */
export function addStockPositionArea(data) {
  return request({
    url: '/distribution/stockPositionArea',
    method: 'post',
    data
  })
}

/**修改仓库区域 */
export function updateStockPositionArea(data) {
  return request({
    url: '/distribution/stockPositionArea',
    method: 'put',
    data
  })
}

/**删除仓库区域 */
export function deleteStockPositionArea(ids) {
  return request({
    url: '/distribution/stockPositionArea/' + ids,
    method: 'delete',
  })
}




// 删除仓库区域
// distribution:stockPositionArea:remove




/**查询仓库区域列表 不分页*/
export function stockPositionAreaListNoPage() {
  return request({
    url: `/distribution/stockPositionArea/listNoPage`,
  })
}


/**获取序列号列表*/
export function getSkuSerializableList(skuId) {
  return request({
    url: `/distribution/stockPosition/getSkuSerializableList?skuId=${skuId}`,
  })
}

/**获取序列号列表-分页*/
export function getSkuSerializableListByPage(params
) {
  return request({
    url: `/distribution/stockPosition/getSkuSerializableListByPage`,
    params
  })
}

/**查询库位*/
export function queryById(id) {
  return request({
    url: `/distribution/stockPosition/queryById?id=${id}`,
  })
}
/**移动到垃圾库位*/
export function moveAbandon(data) {
  return request({
    url: '/distribution/stockPosition/moveAbandon',
    method: 'post',
    data
  })
}

/**获取 移库 库位列表*/
export function queryPageNoSkuList(params) {
  return request({
    url: '/distribution/stockPosition/queryPageNoSkuList',
    params
  })
}

/**库位移库*/
export function moveStockPosition(data) {
  return request({
    url: '/distribution/stockPosition/moveStockPosition',
    method: 'post',
    data
  })
}


/**库位移库绑定SKU*/
export function stockPositionBindSkuTransferSp(data) {
  return request({
    url: '/distribution/stockPosition/stockPositionBindSkuTransferSp',
    method: 'post',
    data
  })
}
/**查询库位SKU 未分配列表 */
export function queryNoPageNoSkuList(query) {
  return request({
    url: '/distribution/stockPosition/queryNoPageNoSkuList',
    params: query
  })
}

// 查询仓库库位列表
export function getStockPositionList(query) {
  return request({
    url: '/distribution/stockPosition/getStockPositionList',
    method: 'get',
    params: query
  })
}

// 获取sku列表
export function getSkuList(query) {
  return request({
    url: '/distribution/sku/getSkuList',
    method: 'get',
    params: query
  })
}

// 库位绑定SKU
export function stockPositionBindSku(query) {
  return request({
    url: '/distribution/stockPosition/stockPositionBindSku',
    method: 'get',
    params: query
  })
}


/**新增库位 */
export function insertBatchStockPosition(data) {
  return request({
    url: '/distribution/stockPosition/insertBatchStockPosition',
    method: 'post',
    data
  })
}


/**修改仓库库位 */
export function updateStockPosition(data) {
  return request({
    url: '/distribution/stockPosition/updateStockPosition',
    method: 'post',
    data
  })
}
